package com.mushuilingfeng.ddd.user.domain.org.vo;

import cn.hutool.core.util.StrUtil;
import com.mushuilingfeng.ddd.user.domain.base.DomainArgumentException;
import com.mushuilingfeng.ddd.framework.vo.IDomainValueObject;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;

import java.util.Date;

/**
 * @author
 * @date 2024/9/18
 */
@AllArgsConstructor
@NoArgsConstructor
@Getter
@Builder
public class OrgApplyResult implements IDomainValueObject {
    private String checkResult;
    private String checkRemark;
    private String checkUserName;
    private String checkUserAccount;
    private Date checkTime;

    @Override
    public void simpleCheckParams() {
        if (StrUtil.isBlankIfStr(checkResult)) {
            throw new DomainArgumentException("审核结果不能为空！");
        }
        if (StrUtil.isBlankIfStr(checkUserName)) {
            throw new DomainArgumentException("审核人不能为空！");
        }
        if (StrUtil.isBlankIfStr(checkUserAccount)) {
            throw new DomainArgumentException("审核账号不能为空！");
        }
    }
}
